package com.leff.pvz.scene;

import org.anddev.andengine.entity.primitive.Rectangle;

import com.leff.pvz.Constants;
import com.leff.pvz.ResourceLibrary;

public class GameScene extends ShareScene implements Constants {

	private static final int NUM_SCENE_LAYERS = 1;
	
	private static GameScene instance;
	public static GameScene getInstance() {
		if(instance == null) {
			instance = new GameScene();
		}
		return instance;
	}
	
	private ShareLayer[] mLayers;
	
	public GameScene() {
		super();
		
		mLayers = new ShareLayer[NUM_SCENE_LAYERS];
		for(int i = 0; i < NUM_SCENE_LAYERS; i++) {
			mLayers[i] = new ShareLayer();
		}
		
		this.setOnAreaTouchTraversalFrontToBack();
		
		ResourceLibrary.GameSceneLibrary L = ResourceLibrary.getInstance().GameScene;
		
		Rectangle redBg = new Rectangle(0, 0, SCENE_WIDTH, SCENE_HEIGHT);
		redBg.setColor(1, 0, 0);
		
		mLayers[0].attachChild(redBg);
		mLayers[0].attachChild(L.testSprite);
			
		for(int i = 0; i < mLayers.length; i++) {
        	this.attachChild(mLayers[i]);
        }
	}

}
